Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
My-Denia
left a comment
There was a problem hiding this comment.
Thanks @frayzis. I tested 73857758c on Windows 11 (RTX 4090 Laptop) with the official OBS Studio 33.0.3 virtual camera (CLSID {A3FCE0F5-3493-419F-958A-ABA1250EC20B}), fed a looping test card with a frame counter. The WGC helper was built from this head and from its parent 2b65ea937 with the same toolchain and flags, so the two binaries differ only by this change.
Pass:
- A/B on the helper. I drove each build directly with a config built from the fields in
electron/ipc/handlers.ts(display capture plusOBS Virtual Cameraat 1280x720@30). The app path is tested separately, below. Both builds miss the device in Media Foundation and fall back to DirectShow (Requested webcam device was not found by Media Foundation; trying DirectShow); only this head logsINFO: OBS Virtual Camera DirectShow graph clock disabled.Build Camera track freezedetectCounter at 2 s / 10 s / 20 s parent 742 frames, 24.7 s frozen from 0 s to the end 23 / 23 / 23 this head (two takes) 743 and 740 frames, 24.7 s no freeze 18 / 26 / 36 - Through the app. I selected OBS Virtual Camera in Device settings and recorded a 29 s take with a ~5 s pause:
- The floating camera preview kept moving during the take (counter 18 → 28, then 44 after resume).
- The camera and screen tracks both came out at 28.834 s, and the camera track has no freeze.
- Media Foundation cameras keep their path. A USB UVC webcam was picked by Media Foundation (
score=1000), and the new branch did not run.
About the evidence in the description. The frame count on its own ("181 camera frames in about six seconds") would look the same without the fix: the frozen parent take above also has ~30 fps of frames, because captureLoop stores whatever GetCurrentBuffer returns on every tick and bumps the sequence each time. The moving test-pattern timecode you checked in the pause test is what tells the two apart (as does ffmpeg -vf freezedetect), so it may be worth leading with that.
Worth checking. I couldn't tie these to the change, but two starts with this head stalled out of about eight:
- Right after a frozen take with the parent helper, the next take with this head spent over two minutes before DirectShow format negotiation (
DirectShow webcam format), which runs before the new code. It then failed withTimed out waiting for first WGC frame. - The first app take after restarting OBS failed with
Timed out waiting for native Windows capture to start. The next app take started in under a second.
After restarting OBS, three direct takes started in under a second. The parent helper only ran twice and didn't stall. My guess is OBS's virtual camera being left in a bad state, not this change.
Small things:
- If
QueryInterface(IMediaFilter)orSetSyncSourcefails,initializereturns false (dshow_webcam_capture.cpp:349-353) and the take continues without a camera. Logging a warning and carrying on with the clock attached would keep today's behaviour as the fallback. - The comment at
:345-347could say why it stalls: OBS stamps samples with absolute reference time and ignorestStart. - The PR template's Type of change, Release impact and Desktop impact boxes are unchecked.
Not covered: a non-OBS DirectShow-only camera (I don't have one), Windows 10 and arm64. The USB webcam smoke test ended with SinkWriter::Finalize failed (0xc00d4a44) because the camera delivered no visible frames in a dark room. The parent helper fails the same way, so I can't read anything about this change from it.
The failing "Rust test (macOS compositor)" job is audio::tests::a_clipped_voice_exports_under_minus_one_dbtp_and_keeps_what_loudness_it_can, which fails the same way on main at 96e3cd327 (run 45831334221). #1678, still open, fixes it.
Fixes #1683
On Windows, OBS Virtual Camera can produce a stuttering preview and a webcam recording that holds its first frame while the screen recording continues. A looping OBS media source reproduces the recording freeze without a phone or physical camera. The same virtual-camera stream records with motion in FFmpeg.
Set a null reference clock on the DirectShow graph for the OBS Virtual Camera CLSID before starting capture. The change is confined to
electron/native/wgc-capture/src/dshow_webcam_capture.cpp. OpenScreen continues to timestamp the screen and camera on its shared recording clock.Validated on Windows 11 with OBS Studio 33.0.3 and the OpenScreen 2.4.0 Store build. The patched helper recorded 181 camera frames in about six seconds without a freeze. In a separate test with a four-second pause, both tracks finished at 12.368 seconds and the test pattern timecode showed no accumulated camera delay after resume. This change targets the saved webcam recording. The preview before recording was not validated.
Summary by CodeRabbit